import request from '@u/request'
import { HttpMethod } from '@u/http'

// 查询公告列表
export function listNotice(query) {
  return request({
    url: `/sys/notice/list`,
    method: HttpMethod.GET,
    params: query
  })
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: '/sys/notice/' + noticeId,
    method: HttpMethod.GET
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/sys/notice',
    method: HttpMethod.POST,
    data: data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/sys/notice',
    method: HttpMethod.PUT,
    data: data
  })
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: '/sys/notice/' + noticeId,
    method: HttpMethod.DELETE
  })
}
